require('net').createServer(function(socket) {
	// new connection
	socket.on('data', function(data) {
	// got data
		console.log(data.toString());
		socket.end(data.toString());
	});
	socket.on('end', function(data) {
	// connection closed
//		console.log(data);
	});
	
}).listen(4001);